package com.hxzy.shop.mapstruct;

import com.github.pagehelper.PageInfo;
import com.hxzy.shop.common.dto.commodity.resp.ClassifiedManagementResp;
import com.hxzy.shop.entity.ClassifiedManagement;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @Author wy
 * @Description  ClassifiedManagment对象转换
 * @Date 2023/7/3 10:30
 * @Version 1.0
 */
@Mapper
public interface ClassifiedManagmentConvert {
    ClassifiedManagmentConvert  INSTANCE= Mappers.getMapper(ClassifiedManagmentConvert.class);

    /**
     * 实体类转换成自定义地象
     * @param entity
     * @return
     */
    ClassifiedManagementResp  convert(ClassifiedManagement entity);

    /**
     * 复制PageInfo对象，除了list数据以外
     * @param pg
     * @return
     */
    @Mapping(target = "list",ignore = true)
    PageInfo<ClassifiedManagementResp> convert(PageInfo<ClassifiedManagement> pg);

}
